var error_text = ('<span class="error">*</span>');

		$('#user_login').submit( function() {
			var flag_submit = true;
			$("span.error").remove();

			if ($.trim($("#uname").val()) == "") {
			  $("#uname").after(error_text);
			  flag_submit = false;
			}
			if ($.trim($("#upass").val()) == "") {
			  $("#upass").after(error_text);
			  flag_submit = false;
			}
			
			if(flag_submit){
				var content = $('#user_login').serializeArray();
				$.ajax({
					type: 'GET',
					url: './module/user/user_login_function.php',
					data: {act:'login', val:content},
					success: function(data) {
						if(data==0){
							alert ('Wrong ID/Password');
						} else if(data==1) {
							setTimeout(window.location.reload(true),2000);
						} else {
							alert ('Unknown Error \n'+ data );
						}
					},
					error: function (){ alert ('Cannot get function file');}
				});
				return true;
			}
			return false;
		}); 